<%@ page language="java" pageEncoding="UTF-8"%><!DOCTYPE html>
<html>
	<head>
		<title></title>
		<jsp:include page="/head.jsp"/>
	</head>
	<body>
    <button class="btn btn-primary m-2">ajax</button>
    <button class="btn btn-primary m-2">ajax错误消息</button>
    <button class="btn btn-primary m-2" onclick="sys.message('自定义错误消息','error')">消息提示</button>
    <button class="btn btn-primary m-2" onclick="sys.notify('自定义成功通知','成功标题','success')">通知提示</button>
    <button class="btn btn-primary m-2" onclick="sys.loading.show();setTimeout(()=>{sys.loading.hide();},5000)">loading</button>
    <script type="text/javascript">
      var btns = document.querySelectorAll("button");
      btns[0].onclick=()=>{
        sys.ajax("api/user/exists",{userName:"admin"},{method:"get"}).then(r=>{
          console.info(r);
        });
      }
      
      btns[1].onclick=()=>{
        sys.ajax("api/user/login",{userName:"admin"}).then(r=>{
          console.info(r);
        }).catch((r)=>{
          console.warn(r);
        });
      }
    </script>
	</body>
</html>
